

from flask import request
from utils.randomUtils import  generate_random_by_time
import threading
from .baseGraphNode import  *
from .sessionInfo import SessionInfo
from ..execute.baseExeHis import BaseExeHis


class ClearGraphNode(BaseGraphNode):
    
    socketio_instances = {}
    def __init__(self, id:str, data:dict, graphNodeManager, random_key:str):
        super().__init__(id, data, graphNodeManager, random_key)

    def execute(self, session_info: SessionInfo=None, exe_his: BaseExeHis=None, trigger=None, running_id=None, **kwargs):
        assert session_info is not None, "session_info should not be None when clear its content"
        self.graphNodeManager.clear_session_info(session_info)
        exe_his.update_content("Clearing session information...")
        if exe_his:exe_his.done()